/****************************************************************************
/  file: io.sc
/  Author: Jungmin Park
/  Date: 04/25/2011
/  Description: IO
****************************************************************************/

#include <stdio.h>
import "c_double_handshake";

behavior IO(i_sender IS1, i_sender IS2, i_receiver IR1, i_receiver IR2)
{
  long input1, input2;
  float out_re, out_im;
  int i;
  void main(void) 
  {  
    input1 = 0x1234abcd;
    input2 = 0x36478fac;
    IS1.send (&input1, sizeof(input1));
    IS2.send (&input2, sizeof(input1));
        
    printf ("-------- The output ----------\n"); 
    for (i=0; i<16; i++)
    {
      IR1.receive (&out_re, sizeof(out_re));
      IR2.receive (&out_im, sizeof(out_re));
      printf ("Y[%d] = %f+i%f \n", i, out_re, out_im);
    }
  }
};